home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / earkit / socket / install_miami next >
Text File  |  1997-02-15  |  8KB  |  299 lines

  1. (procedure check-system-version
  2.  (set exec-version (/ (getversion) 65536))
  3.  (if (< exec-version 37)
  4.   (abort "Miami 2.0 needs Kickstart 2.04 or higher.\n")
  5.  )
  6.  (if (< exec-version 39)
  7.   (set ag-browser "AmigaGuide")
  8.   (set ag-browser "MultiView")
  9.  )
  10. )
  11.  
  12. (procedure select-destination-directory
  13.  (if (exists "Miami:" (noreq))
  14.   (
  15.    (set old-miami-assign 1)
  16.    (set old-miami-assign-location (expandpath "Miami:"))
  17.    (set @default-dest
  18.     (askdir
  19.      (prompt "Select the directory where you want to "
  20.       "install Miami 2.0. You already have a 'Miami:' "
  21.       "assign on your system, so it is assumed that this "
  22.       "is the location of an older version of Miami that "
  23.       "you want to upgrade.")
  24.      (help "Select the directory where you want to "
  25.       "install Miami 2.0. Since you already have a 'Miami:' "
  26.       "assign on your system you should probably accept "
  27.       "the default.")
  28.      (default "Miami:")
  29.     )
  30.    )
  31.   ) (
  32.    (set old-miami-assign 0)
  33.    (set @default-dest
  34.     (askdir
  35.      (prompt "Select the directory where you want to "
  36.       "install Miami 2.0. Most of the files do not have "
  37.       "to be copied if you accept the default. A separate "
  38.       "directory WILL NOT be created at the location you "
  39.       "specify.")
  40.      (help "Select the directory where you want to "
  41.       "install Miami 2.0. You can choose to install "
  42.       "'in-place', i.e. within the directory where your "
  43.       "Miami files are currently located, or you can have "
  44.       "Miami installed in a different location, copying "
  45.       "all files.")
  46.      (default source-dir)
  47.     )
  48.    )
  49.   )
  50.  )
  51.  (makeassign "Miami" @default-dest)
  52. )
  53.  
  54. (procedure check-registered
  55.  (set is-registered (exists (tackon @default-dest "Miami.key2")))
  56. )
  57.  
  58. (procedure select-cpu
  59.  (if is-registered
  60.   (set cpu-choice
  61.    (askchoice
  62.     (prompt "Please select which version of\nMiami you want to use:")
  63.     (help "Miami exists in an 68000 version\nand an 68020 version. The "
  64.      "68020 version\ncan only be used by registered users.")
  65.     (choices "68000 version" "68020 version")
  66.    )
  67.   )
  68.   (set cpu-choice 0)
  69.  )
  70. )
  71.  
  72. (procedure select-icon
  73.  (set icon-choice
  74.   (askchoice
  75.    (prompt "Please select which icons you\nwant to use:")
  76.    (help "Miami comes with three different\nicon styles. Please select\n"
  77.     "the one you prefer.")
  78.    (choices "standard" "Magic Workbench" "NewIcons")
  79.   )
  80.  )
  81. )
  82.  
  83. (procedure check-in-place
  84.  (set is-in-place
  85.   (= (expandpath source-dir) (expandpath @default-dest))
  86.  )
  87. )
  88.  
  89. (procedure copy-file
  90.  (copyfiles
  91.   (source (tackon source-dir to-copy))
  92.   (dest @default-dest)
  93.   (optional force)
  94.  )
  95. )
  96.  
  97. (procedure copy-files
  98.  (if (exists (tackon @default-dest "Miami"))
  99.   (delete (tackon @default-dest "Miami") force)
  100.  )
  101.  (if (exists (tackon @default-dest "Miami.info"))
  102.   (delete (tackon @default-dest "Miami.info") force)
  103.  )
  104.  (if is-in-place
  105.   (
  106.    (if cpu-choice
  107.     (
  108.      (delete (tackon @default-dest "Miami.000") force)
  109.      (delete (tackon @default-dest "Miami.000.info") force)
  110.      (rename (tackon @default-dest "Miami.020") (tackon @default-dest "Miami"))
  111.      (rename (tackon @default-dest "Miami.020.info") (tackon @default-dest "Miami.info"))
  112.     )
  113.     (
  114.      (delete (tackon @default-dest "Miami.020") force)
  115.      (delete (tackon @default-dest "Miami.020.info") force)
  116.      (rename (tackon @default-dest "Miami.000") (tackon @default-dest "Miami"))
  117.      (rename (tackon @default-dest "Miami.000.info") (tackon @default-dest "Miami.info"))
  118.     )
  119.    )
  120.    (complete 50)
  121.   ) (
  122.    (if cpu-choice
  123.     (set to-copy "Miami.020")
  124.     (set to-copy "Miami.000")
  125.    )
  126.    (copy-file)
  127.    (if cpu-choice
  128.     (rename (tackon @default-dest "Miami.020") (tackon @default-dest "Miami"))
  129.     (rename (tackon @default-dest "Miami.000") (tackon @default-dest "Miami"))
  130.    )
  131.    (set to-copy "Miami.guide") (copy-file)
  132.    (set to-copy "Miami.guide.info") (copy-file)
  133.    (set to-copy "MiamiArp") (copy-file)
  134.    (set to-copy "MiamiFinger") (copy-file)
  135.    (set to-copy "MiamiIfConfig") (copy-file)
  136.    (set to-copy "MiamiInit") (copy-file)
  137.    (set to-copy "MiamiInit.info") (copy-file)
  138.    (set to-copy "MiamiInitSANA2") (copy-file)
  139.    (set to-copy "MiamiInitSANA2.info") (copy-file)
  140.    (set to-copy "MiamiNetStat") (copy-file)
  141.    (set to-copy "MiamiPing") (copy-file)
  142.    (set to-copy "MiamiRegister") (copy-file)
  143.    (set to-copy "MiamiRegister.info") (copy-file)
  144.    (set to-copy "MiamiResolve") (copy-file)
  145.    (set to-copy "MiamiRoute") (copy-file)
  146.    (set to-copy "MiamiSysCtl") (copy-file)
  147.    (set to-copy "MiamiTCPDump") (copy-file)
  148.    (set to-copy "MiamiTraceRoute") (copy-file)
  149.    (set to-copy "README_FIRST") (copy-file)
  150.    (set to-copy "README_FIRST.info") (copy-file)
  151.    (complete 25)
  152.    (if (not (exists (tackon @default-dest "libs")))
  153.     (makedir (tackon @default-dest "libs"))
  154.    )
  155.    (copyfiles
  156.     (source (tackon source-dir "libs"))
  157.     (dest (tackon @default-dest "libs"))
  158.     (all)
  159.    )
  160.   )
  161.  )
  162.  (set to-copy
  163.   (select icon-choice
  164.    "Icons/Standard/Miami.info"
  165.    "Icons/MagicWB/Miami.info"
  166.    "Icons/NewIcons/Miami.info"
  167.   )
  168.  )
  169.  (copyfiles
  170.   (source (tackon source-dir to-copy))
  171.   (dest @default-dest)
  172.  )
  173.  (copyfiles
  174.   (source (tackon source-dir to-copy))
  175.   (dest @default-dest)
  176.   (newname "MiamiInit.info")
  177.  )
  178.  (copyfiles
  179.   (source (tackon source-dir to-copy))
  180.   (dest @default-dest)
  181.   (newname "MiamiInitSANA2.info")
  182.  )
  183.  (copyfiles
  184.   (source (tackon source-dir to-copy))
  185.   (dest @default-dest)
  186.   (newname "MiamiRegister.info")
  187.  )
  188.  (complete 50)
  189. )
  190.  
  191. (procedure set-tooltypes
  192.  (tooltype
  193.   (dest (tackon @default-dest "Miami"))
  194.   (noposition)
  195.  )
  196.  (tooltype
  197.   (dest (tackon @default-dest "MiamiInit"))
  198.   (noposition)
  199.  )
  200.  (tooltype
  201.   (dest (tackon @default-dest "MiamiInitSANA2"))
  202.   (noposition)
  203.  )
  204.  (tooltype
  205.   (dest (tackon @default-dest "MiamiRegister"))
  206.   (noposition)
  207.  )
  208.  (tooltype
  209.   (dest (tackon @default-dest "Miami.guide"))
  210.   (noposition)
  211.   (setdefaulttool ag-browser)
  212.  )
  213. )
  214.  
  215. (procedure add-to-startup
  216.  (if old-miami-assign
  217.   (if (= (old-miami-assign-location (expandpath @default-dest)))
  218.    (set change-startup 0)
  219.    (set change-startup 1)
  220.   )
  221.   (set change-startup 1)
  222.  )
  223.  (if change-startup
  224.   (
  225.    (set startup-addition (cat
  226.     "assign Miami: \"" (expandpath @default-dest) "\"\n"
  227.     )
  228.    )
  229.    (if
  230.     (askbool
  231.      (prompt "It is strongly recommended that an assign "
  232.       "'Miami:' is created for the Miami installation "
  233.       "directory. Miami by itself will work fine without "
  234.       "this assign, but some utility programs like "
  235.       "MiamiTCPDump need it. Would you like Installer "
  236.       "to make the required change to your user-startup "
  237.       "file ?")
  238.      (help "It is strongly recommended that an assign "
  239.       "'Miami:' is created for the Miami installation "
  240.       "directory. Miami by itself will work fine without "
  241.       "this assign, but some utility programs like "
  242.       "MiamiTCPDump need it. Please indicate if you would like Installer "
  243.       "to make the required change to your user-startup "
  244.       "file.")
  245.      (choices "Yes" "No")
  246.     )
  247.     (startup "Miami"
  248.      (command startup-addition)
  249.      (prompt "Installer will modify your s:user-startup "
  250.       "script. The following lines will be added:\n\n"
  251.       startup-addition)
  252.      (help "Installer will modify your s:user-startup "
  253.       "script. The following lines will be added:\n\n"
  254.       startup-addition)
  255.     )
  256.     (textfile
  257.      (dest (tackon @default-dest "addition-to-user-startup"))
  258.      (append startup-addition)
  259.     )
  260.    )
  261.   )
  262.  )
  263. )
  264.      
  265.  
  266. ;;;; Start
  267.  
  268. (welcome "Welcome to the Miami 2.0 installation.\n")
  269.  
  270. (set app-name "Miami 2.0")
  271.  
  272. (check-system-version)
  273.  
  274. (complete 0)
  275.  
  276. (set source-dir (if (= 1 (exists @icon)) (pathonly (expandpath @icon))
  277.  (expandpath @icon))
  278. )
  279.  
  280. (select-destination-directory)
  281.  
  282. (check-registered)
  283.  
  284. (select-cpu)
  285.  
  286. (select-icon)
  287.  
  288. (check-in-place)
  289.  
  290. (copy-files)
  291.  
  292. (set-tooltypes)
  293.  
  294. (complete 75)
  295.  
  296. (add-to-startup)
  297.  
  298. (complete 100)
  299.